package com.mzjf;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Germmy on 2018/7/4.
 */
@RestController
public class LoginConroller {
    private final Logger logger = LoggerFactory.getLogger(LoginConroller.class);

    @LogAnnotation(targetType = "user", action = "create", remark = "用户登录")
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String login(HttpServletRequest request) {
        String userName = request.getParameter("userName");
        String password = request.getParameter("password");
        String imgCode = request.getParameter("imageCode");
        logger.info("input code is " + imgCode + " session id is " + request.getSession().getId());
        return "loginSuccess";
    }

}
